unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids, DBClient, Provider, ADODB, StdCtrls;

type
  TForm1 = class(TForm)
    adqDetailLock: TADOQuery;
    dspDetailLock: TDataSetProvider;
    cdsDetailLock: TClientDataSet;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  with cdsDetailLock do
  begin
    Close;
    Params[0].Value := '1';
    Params[1].Value := 0;
    Params[2].Value := '1';
    Params[3].Value := 0;
    Params[4].Value := 0;
    Open;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if cdsDetailLock.Locate('detail_sn',1,[]) then
    ShowMessage('123');
end;

end.
